package cn.weiyang.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

/**
 * Created by Administrator on 2017/7/24.
 */
@Controller
public class IndexController {
    @RequestMapping("/")
    public String showHome(){
        return "index";
    }
    /*modelmap、session都可以向前台网页中传值*/
    @RequestMapping("/t")
    public String showHome1(ModelMap modelMap){
        modelMap.addAttribute("pagename",765443);
        return "index";
    }
    @RequestMapping("/t1")
    public String showHome2(HttpSession session){
        session.setAttribute("pagename","中方");
        return "index";
    }
}
